I'm gonna overwrite a lot of this notebook's old content. I changed the way I'm calculating wt, and wanna test that my training worked.
In [1]:
%load_ext autoreload
%autoreload 2
In [2]:
from pearce.emulator import OriginalRecipe, ExtraCrispy
from pearce.mocks import cat_dict
import numpy as np
from os import path
In [3]:
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
In [4]:
#training_file = '/u/ki/swmclau2/des/wt_trainer3/PearceRedMagicChinchillaWT.hdf5'
training_file = '/u/ki/swmclau2/des/ds_trainer3/PearceRedMagicChindhillaDS.hdf5'
em_method = 'gp'
split_method = 'random'
In [5]:
a = 0.81120
z = 1.0/a - 1.0
In [6]:
fixed_params = {'z':z}#, 'r':0.18477483}
In [7]:
emu = OriginalRecipe(training_file, method = em_method, fixed_params=fixed_params, independent_variable=None,\
custom_mean_function = None, downsample_factor = 1.0)
In [8]:
#chain = np.genfromtxt('/u/ki/swmclau2/des/PearceMCMC/200_walkers_1000_steps_wtheta_exp2_hyperparams.npy')
chain = np.genfromtxt('/u/ki/swmclau2/des/PearceMCMC/200_walkers_1000_steps_delta_sigma_exp2_hyperparams.npy')
#v = chain.mean(axis = 0)
n_burn = 0
v = chain[200*n_burn:,].mean(axis = 0)
In [9]:
emu._emulator.set_parameter_vector(v)
In [10]:
#TODO other z's
sc_inv = 0.0001239041803415539
W = 0.00275848072207
In [11]:
chain_fname = '/u/ki/swmclau2/des/PearceMCMC/200_walkers_50000_steps_chain_redmagic_bias_z0.23.npy'
In [12]:
hod_param_names = ['logMmin','f_c', 'logM0', 'sigma_logM', 'logM1', 'alpha']
In [16]:
chain = np.genfromtxt(chain_fname)
n_burn, n_walkers = 40000, 200
chain = chain[n_walkers*n_burn:, :]
In [17]:
print hod_param_names
print emu.get_param_names()
In [24]:
i = 0
for vals in chain:
params = dict(zip(hod_param_names, vals))
obs = emu.emulate_wrt_r(params, emu.scale_bin_centers)
print params
plt.plot(emu.scale_bin_centers, sc_inv*obs[0])
i+=1
if i>5:
break
plt.ylabel(r"$\gamma_t(\theta)$")
plt.xlabel(r"$\theta$ [deg]")
#plt.loglog()
plt.xscale('log')
plt.title("Samples from HOD Chains")
plt.show();
In [22]:
params
Out[22]:
In [20]:
obs
Out[20]:
In [ ]:
In [ ]: